#ifndef scenary_object_h
#define scenary_object_h

#include "GameObject.h"
#include "ScenarySprite.h"

//use ScenarySprite instead of Sprite
class ScenaryObject : public GameObject
{
public:
	ScenaryObject(int id, D3DXVECTOR2 position, int MovingWidth, GameObjectType ScenaryType ) 
		: GameObject(id, position, MovingWidth, ScenaryType)
	{
		_collisionObj = false;
	}

	~ScenaryObject(){ delete _sprite;}
	 void LoadResources(LPD3DXSPRITE SpriteHandler, Texture *texture, GameObjectType type)
	 {
		 switch (type)
		 {
		 case STree: 
			 _sprite = new ScenarySprite(SpriteHandler,texture, 167, 0, 64, 152);
			 break;
		 case SFlower:
			 _sprite = new ScenarySprite(SpriteHandler,texture, 0, 67, 120, 59);
			 break;
		 case SCloud:
			 _sprite = new ScenarySprite(SpriteHandler,texture, 0, 0, 167, 67);
			 break;
		 default:
			 break;
		 }
	 }
	void RenderFrame(LPDIRECT3DSURFACE9 BackBuffer, ViewPort *viewport)
	{
		_sprite -> Render(BackBuffer, (int)_position.x, (int)_position.y, 255, 1, 1, viewport);
	}
private:
	ScenarySprite * _sprite;
};

#endif